<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

    <title>oauth github</title>
</head>
<body>
登陆中...

</body>
<script>
    $(function () {

        // 获取当前页面的 URL
        const url = new URL(window.location.href);
        const baseURL = `${url.protocol}//${url.host}`;
        // 获取 URL 参数
        const params = new URLSearchParams(url.search);
        // 获取 token 值
        const token = params.get('token');
        const loginName = params.get("loginName");
        const loginAccount = params.get("loginAccount");
        const code = params.get("code");

        let data = {"token": token, "loginName": loginName,"loginAccount":loginAccount,"code":code};
        const openerWindow = window.opener;
        if (openerWindow) {
            openerWindow.postMessage(data, baseURL);
        }
        window.close();
    });
</script>
</html>
